#include <stdlib.h>
#include <stdio.h>

int main(int argc, char ** argv)
{
	FILE * fp = NULL;
	unsigned char * buf = NULL;
	int len = 0;
	int read = 0;
	
	if (argc < 2)
	{
		fprintf(stderr, "Usage: test [file name]\n");
		exit(1);
	}
	
	fp = fopen(argv[1], "rb");
	
	fseek(fp, 0, SEEK_END);
	
	len = ftell(fp);
	
	fseek(fp, 0, SEEK_SET);
	
	buf = (unsigned char *)malloc(len * sizeof(unsigned char));
	
	read = fread(buf, sizeof(unsigned char), len, fp);
	
	for(len = 0; len < read; len++)
	{
		printf("0x%x,", buf[len]);
		
		if ((len % 20) == 0)
			printf("\n");
	}
	
	free(buf);
	fclose(fp);
	
	return 0;
}